/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.ReTopicDAO;
import com.sesame.domain.ReTopic;

/**
 * @author voidman
 * 
 */
public class ReTopicDAOImpl extends SqlMapClientDaoSupport implements ReTopicDAO {

    public void addReTopic(ReTopic ReTopic) {
        getSqlMapClientTemplate().insert("addReTopic", ReTopic);
    }

    public void deleteReTopicById(Integer id) {
        getSqlMapClientTemplate().delete("deleteReTopicById", id);
    }

    @SuppressWarnings("unchecked")
    public List<ReTopic> getAllReTopic() {
        List<ReTopic> listReTopic;
        listReTopic = getSqlMapClientTemplate().queryForList("getAllReTopic");
        return listReTopic;
    }
    
    public ReTopic getReTopicById(Integer id) {

        return (ReTopic) getSqlMapClientTemplate().queryForObject("getReTopicById", id);
    }

    public void updateReTopic(ReTopic ReTopic) {
        getSqlMapClientTemplate().update("updateReTopic", ReTopic);
    }

}
